<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除数组中元素</title>
</head>
<body>
<script>
    var a=[1,2,3,4,5];
    console.log(a.length);
    delete a[4];
    console.log(a.length);
    console.log(a);
    var b=[undefined,undefined,undefined];
    console.log(b.length);
    console.log(b);
    var c=[];
    c[2]=0;
    console.log(c.length);
    console.log(c);
    a.max=5;
    console.log(a.max);
    delete a.max;
    console.log(a.max);//undefined
</script>
</body>
</html>